package com.qingke.lol;


public class Team {
	private String teamName;
	private Hero top;
	private Hero jungle;
	private Hero mid;
	private Hero adc;
	private Hero support;
	public Hero[] team;
	public Team(String teamName,String top,String jungle,String mid,String adc,String support){
		this.teamName=teamName;
		this.top=new Hero(top);
		this.jungle=new Hero(jungle);
		this.mid=new Hero(mid);
		this.adc=new Hero(adc);
		this.support=new Hero(support);
		this.team=new Hero[]{this.top,this.jungle,this.mid,this.adc,this.support};
	}
	public void act(Team t){
		for(int i=0;i<5;i++){
			
			this.team[i].act(this,t);
			t.team[i].act(t,this);
		}
		
	}
	public String getTeamName() {
		return teamName;
	}
	public boolean isAlive(){
		for(int i=0;i<team.length;i++){
			if(team[i].alive)
				return true;
		}
		return false;
	}
	public void recovery(){
		for(int j=0;j<team.length;j++){
			this.team[j].recovery();
		}
	}
	public void recoverLive(){
		for(int j=0;j<team.length;j++){
			this.team[j].recoverLive();
		}
	}
}
